<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SimpleWindow: MenuItem.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SimpleWindow
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_menu_item_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">MenuItem.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="preprocessor">#include &quot;ITag.h&quot;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="preprocessor">#include &lt;Windows.h&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#include &lt;initializer_list&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="keyword">namespace </span>sw</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span>{</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span>    <span class="keyword">class </span>MenuItem; <span class="comment">// 向前声明</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>    <span class="keyword">using </span>MenuItemCommand = std::function&lt;void(MenuItem &amp;)&gt;;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span> </div>
<div class="foldopen" id="foldopen00023" data-start="{" data-end="};">
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html">   23</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classsw_1_1_menu_item.html">MenuItem</a> : <span class="keyword">public</span> <a class="code hl_class" href="classsw_1_1_i_tag.html">ITag</a></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>    {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a71e23c18ace7346f28415ed747d80905">   29</a></span>        <a class="code hl_class" href="classsw_1_1_dictionary.html">uint64_t</a> <a class="code hl_variable" href="classsw_1_1_menu_item.html#a71e23c18ace7346f28415ed747d80905">tag</a>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">   34</a></span>        std::wstring <a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a2a89a577f6cc2eafe9b6d55eb3c9c8ee">   39</a></span>        MenuItemCommand <a class="code hl_variable" href="classsw_1_1_menu_item.html#a2a89a577f6cc2eafe9b6d55eb3c9c8ee">command</a>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#ac8e01802bb6cc6f1336025819050f3c4">   44</a></span>        std::vector&lt;std::shared_ptr&lt;MenuItem&gt;&gt; <a class="code hl_variable" href="classsw_1_1_menu_item.html#ac8e01802bb6cc6f1336025819050f3c4">subItems</a>{};</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a45cb03eb9423fbe1c187f237ec89377a">   51</a></span>        <a class="code hl_function" href="classsw_1_1_menu_item.html#a45cb03eb9423fbe1c187f237ec89377a">MenuItem</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#afc23694c9e8b0cba6910f360e96e07ac">   58</a></span>        <a class="code hl_function" href="classsw_1_1_menu_item.html#afc23694c9e8b0cba6910f360e96e07ac">MenuItem</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>, <span class="keyword">const</span> MenuItemCommand &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a2a89a577f6cc2eafe9b6d55eb3c9c8ee">command</a>);</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#af68934d85fe10b3b01bf4038d66275e4">   65</a></span>        <a class="code hl_function" href="classsw_1_1_menu_item.html#af68934d85fe10b3b01bf4038d66275e4">MenuItem</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>, std::initializer_list&lt;MenuItem&gt; <a class="code hl_variable" href="classsw_1_1_menu_item.html#ac8e01802bb6cc6f1336025819050f3c4">subItems</a>);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a202803354be2beb12a1cf1aa5cab00b6">   71</a></span>        <a class="code hl_function" href="classsw_1_1_menu_item.html#a202803354be2beb12a1cf1aa5cab00b6">MenuItem</a>(<a class="code hl_class" href="classsw_1_1_dictionary.html">uint64_t</a> <a class="code hl_variable" href="classsw_1_1_menu_item.html#a71e23c18ace7346f28415ed747d80905">tag</a>, <span class="keyword">const</span> std::wstring &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>);</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a5abf91fc5b59265e48a5add77b6030c1">   78</a></span>        <a class="code hl_function" href="classsw_1_1_menu_item.html#a5abf91fc5b59265e48a5add77b6030c1">MenuItem</a>(<a class="code hl_class" href="classsw_1_1_dictionary.html">uint64_t</a> <a class="code hl_variable" href="classsw_1_1_menu_item.html#a71e23c18ace7346f28415ed747d80905">tag</a>, <span class="keyword">const</span> std::wstring &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>, <span class="keyword">const</span> MenuItemCommand &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a2a89a577f6cc2eafe9b6d55eb3c9c8ee">command</a>);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span> </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00087" data-start="{" data-end="}">
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a8a140ecb317179de2ed111974666bae1">   87</a></span>        <a class="code hl_function" href="classsw_1_1_menu_item.html#a8a140ecb317179de2ed111974666bae1">MenuItem</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>, T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">obj</a>, <span class="keywordtype">void</span> (T::*<a class="code hl_class" href="classsw_1_1_dictionary.html">handler</a>)(<a class="code hl_class" href="classsw_1_1_menu_item.html">MenuItem</a> &amp;))</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>            : <a class="code hl_class" href="classsw_1_1_menu_item.html">MenuItem</a>(0, <a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>, <a class="code hl_class" href="classsw_1_1_dictionary.html">obj</a>, <a class="code hl_class" href="classsw_1_1_dictionary.html">handler</a>)</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>        {</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>        }</div>
</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00099" data-start="{" data-end="}">
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a89486612b9f4dde7765430494bd9e034">   99</a></span>        <a class="code hl_function" href="classsw_1_1_menu_item.html#a89486612b9f4dde7765430494bd9e034">MenuItem</a>(<a class="code hl_class" href="classsw_1_1_dictionary.html">uint64_t</a> <a class="code hl_variable" href="classsw_1_1_menu_item.html#a71e23c18ace7346f28415ed747d80905">tag</a>, <span class="keyword">const</span> std::wstring &amp;<a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>, T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">obj</a>, <span class="keywordtype">void</span> (T::*<a class="code hl_class" href="classsw_1_1_dictionary.html">handler</a>)(<a class="code hl_class" href="classsw_1_1_menu_item.html">MenuItem</a> &amp;))</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>            : <a class="code hl_class" href="classsw_1_1_menu_item.html">MenuItem</a>(<a class="code hl_variable" href="classsw_1_1_menu_item.html#a71e23c18ace7346f28415ed747d80905">tag</a>, <a class="code hl_variable" href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">text</a>)</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>        {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>            T *<a class="code hl_class" href="classsw_1_1_dictionary.html">pObj</a>       = &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">obj</a>;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>            this-&gt;command = [<a class="code hl_class" href="classsw_1_1_dictionary.html">pObj</a>, <a class="code hl_class" href="classsw_1_1_dictionary.html">handler</a>](<a class="code hl_class" href="classsw_1_1_menu_item.html">MenuItem</a> &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">item</a>) { (<a class="code hl_class" href="classsw_1_1_dictionary.html">pObj</a>-&gt;*<a class="code hl_class" href="classsw_1_1_dictionary.html">handler</a>)(<a class="code hl_class" href="classsw_1_1_dictionary.html">item</a>); };</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span>        }</div>
</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a136e71998ffff40e3d165749ba7f7306">  110</a></span>        <span class="keywordtype">bool</span> <a class="code hl_function" href="classsw_1_1_menu_item.html#a136e71998ffff40e3d165749ba7f7306">IsSeparator</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a1b1b34eaed41f83ca8e6072c0db486a0">  115</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classsw_1_1_menu_item.html#a1b1b34eaed41f83ca8e6072c0db486a0">CallCommand</a>();</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#a1187cb70902ab261b8302e7c0c561da9">  120</a></span>        <span class="keyword">virtual</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">uint64_t</a> <a class="code hl_function" href="classsw_1_1_menu_item.html#a1187cb70902ab261b8302e7c0c561da9">GetTag</a>() <span class="keyword">override</span>;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span> </div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="classsw_1_1_menu_item.html#ab0b1236f09532f993324f76c07c7b8c7">  125</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classsw_1_1_menu_item.html#ab0b1236f09532f993324f76c07c7b8c7">SetTag</a>(<a class="code hl_class" href="classsw_1_1_dictionary.html">uint64_t</a> <a class="code hl_variable" href="classsw_1_1_menu_item.html#a71e23c18ace7346f28415ed747d80905">tag</a>) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>    };</div>
</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span>}</div>
<div class="ttc" id="aclasssw_1_1_dictionary_html"><div class="ttname"><a href="classsw_1_1_dictionary.html">sw::Dictionary</a></div><div class="ttdoc">字典类，内部维护了一个指向std::map的智能指针</div><div class="ttdef"><b>Definition</b> Dictionary.h:24</div></div>
<div class="ttc" id="aclasssw_1_1_i_tag_html"><div class="ttname"><a href="classsw_1_1_i_tag.html">sw::ITag</a></div><div class="ttdoc">Tag接口</div><div class="ttdef"><b>Definition</b> ITag.h:11</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html"><div class="ttname"><a href="classsw_1_1_menu_item.html">sw::MenuItem</a></div><div class="ttdoc">菜单项</div><div class="ttdef"><b>Definition</b> MenuItem.h:24</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a0f67fc28cb879876a328495035031979"><div class="ttname"><a href="classsw_1_1_menu_item.html#a0f67fc28cb879876a328495035031979">sw::MenuItem::text</a></div><div class="ttdeci">std::wstring text</div><div class="ttdoc">菜单项的文本，当值为“-”时表示当前项为分隔条</div><div class="ttdef"><b>Definition</b> MenuItem.h:34</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a1187cb70902ab261b8302e7c0c561da9"><div class="ttname"><a href="classsw_1_1_menu_item.html#a1187cb70902ab261b8302e7c0c561da9">sw::MenuItem::GetTag</a></div><div class="ttdeci">virtual uint64_t GetTag() override</div><div class="ttdoc">获取Tag</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a136e71998ffff40e3d165749ba7f7306"><div class="ttname"><a href="classsw_1_1_menu_item.html#a136e71998ffff40e3d165749ba7f7306">sw::MenuItem::IsSeparator</a></div><div class="ttdeci">bool IsSeparator() const</div><div class="ttdoc">获取一个值，表示当前菜单项是否为分隔条</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a1b1b34eaed41f83ca8e6072c0db486a0"><div class="ttname"><a href="classsw_1_1_menu_item.html#a1b1b34eaed41f83ca8e6072c0db486a0">sw::MenuItem::CallCommand</a></div><div class="ttdeci">void CallCommand()</div><div class="ttdoc">调用command</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a202803354be2beb12a1cf1aa5cab00b6"><div class="ttname"><a href="classsw_1_1_menu_item.html#a202803354be2beb12a1cf1aa5cab00b6">sw::MenuItem::MenuItem</a></div><div class="ttdeci">MenuItem(uint64_t tag, const std::wstring &amp;text)</div><div class="ttdoc">构造一个MenuItem，并设置tag及文本</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a2a89a577f6cc2eafe9b6d55eb3c9c8ee"><div class="ttname"><a href="classsw_1_1_menu_item.html#a2a89a577f6cc2eafe9b6d55eb3c9c8ee">sw::MenuItem::command</a></div><div class="ttdeci">MenuItemCommand command</div><div class="ttdoc">菜单项被单击时调用的函数</div><div class="ttdef"><b>Definition</b> MenuItem.h:39</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a45cb03eb9423fbe1c187f237ec89377a"><div class="ttname"><a href="classsw_1_1_menu_item.html#a45cb03eb9423fbe1c187f237ec89377a">sw::MenuItem::MenuItem</a></div><div class="ttdeci">MenuItem(const std::wstring &amp;text)</div><div class="ttdoc">构造一个MenuItem，并设置文本</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a5abf91fc5b59265e48a5add77b6030c1"><div class="ttname"><a href="classsw_1_1_menu_item.html#a5abf91fc5b59265e48a5add77b6030c1">sw::MenuItem::MenuItem</a></div><div class="ttdeci">MenuItem(uint64_t tag, const std::wstring &amp;text, const MenuItemCommand &amp;command)</div><div class="ttdoc">构造一个MenuItem，并设置tag及回调函数</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a71e23c18ace7346f28415ed747d80905"><div class="ttname"><a href="classsw_1_1_menu_item.html#a71e23c18ace7346f28415ed747d80905">sw::MenuItem::tag</a></div><div class="ttdeci">uint64_t tag</div><div class="ttdoc">储存用户自定义信息</div><div class="ttdef"><b>Definition</b> MenuItem.h:29</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a89486612b9f4dde7765430494bd9e034"><div class="ttname"><a href="classsw_1_1_menu_item.html#a89486612b9f4dde7765430494bd9e034">sw::MenuItem::MenuItem</a></div><div class="ttdeci">MenuItem(uint64_t tag, const std::wstring &amp;text, T &amp;obj, void(T::*handler)(MenuItem &amp;))</div><div class="ttdoc">构造一个MenuItem，设置成员函数为回调函数</div><div class="ttdef"><b>Definition</b> MenuItem.h:99</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_a8a140ecb317179de2ed111974666bae1"><div class="ttname"><a href="classsw_1_1_menu_item.html#a8a140ecb317179de2ed111974666bae1">sw::MenuItem::MenuItem</a></div><div class="ttdeci">MenuItem(const std::wstring &amp;text, T &amp;obj, void(T::*handler)(MenuItem &amp;))</div><div class="ttdoc">构造一个MenuItem，设置成员函数为回调函数</div><div class="ttdef"><b>Definition</b> MenuItem.h:87</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_ab0b1236f09532f993324f76c07c7b8c7"><div class="ttname"><a href="classsw_1_1_menu_item.html#ab0b1236f09532f993324f76c07c7b8c7">sw::MenuItem::SetTag</a></div><div class="ttdeci">virtual void SetTag(uint64_t tag) override</div><div class="ttdoc">设置Tag</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_ac8e01802bb6cc6f1336025819050f3c4"><div class="ttname"><a href="classsw_1_1_menu_item.html#ac8e01802bb6cc6f1336025819050f3c4">sw::MenuItem::subItems</a></div><div class="ttdeci">std::vector&lt; std::shared_ptr&lt; MenuItem &gt; &gt; subItems</div><div class="ttdoc">子项</div><div class="ttdef"><b>Definition</b> MenuItem.h:44</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_af68934d85fe10b3b01bf4038d66275e4"><div class="ttname"><a href="classsw_1_1_menu_item.html#af68934d85fe10b3b01bf4038d66275e4">sw::MenuItem::MenuItem</a></div><div class="ttdeci">MenuItem(const std::wstring &amp;text, std::initializer_list&lt; MenuItem &gt; subItems)</div><div class="ttdoc">构造一个MenuItem，并设置其子项</div></div>
<div class="ttc" id="aclasssw_1_1_menu_item_html_afc23694c9e8b0cba6910f360e96e07ac"><div class="ttname"><a href="classsw_1_1_menu_item.html#afc23694c9e8b0cba6910f360e96e07ac">sw::MenuItem::MenuItem</a></div><div class="ttdeci">MenuItem(const std::wstring &amp;text, const MenuItemCommand &amp;command)</div><div class="ttdoc">构造一个MenuItem，并设置其回调函数</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_01fcd3835fb4e7d9331b722d86291b65.html">sw</a></li><li class="navelem"><a class="el" href="dir_ed5f6ece24ffcc4307a76d27c2494db3.html">inc</a></li><li class="navelem"><b>MenuItem.h</b></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
  </ul>
</div>
</body>
</html>
